var main = angular.module('main');

main.controller('headerCtrl', ['http', '$state', '$scope', function(http, $state, $scope) {
    $scope.logout = function() {
        http.post('/user/logout',{}).then(function(data) {
        	console.log(data);
            if (data.code === 0) {
                $state.go('login');
            }
        });
    };
}]);